package com.hmall.feign.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import java.util.Collection;

/**
 * feign的拦截器
 *
 * @Author XiaoJiangShi
 * @Date 2022/8/11 19:42
 * @Blog blog.XiaoJiangShi.net/996.mba
 * @Description: feign
 */
@Slf4j
@Component
public class FeignInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        log.info("---->request：[{}]", requestTemplate.url());
        requestTemplate.header("authorization ", "2");
    }
}

